package ua.com.fesvlast.hotel.model.connectionpool;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import ua.com.fesvlast.hotel.controller.managers.ConfigurationManager;

public class DBUtil {
	
	private static final String USERNAME=ConfigurationManager.getInstance().getProperty(ConfigurationManager.DATABASE_USER);
	private static final String PASSWORD=ConfigurationManager.getInstance().getProperty(ConfigurationManager.DATABASE_PASSWORD);
	private static final String M_CONN_STRING=ConfigurationManager.getInstance().getProperty(ConfigurationManager.DATABASE_URL);
	
	
	
	public static Connection getConnection(){
		try {
			return DriverManager.getConnection(M_CONN_STRING,USERNAME,
					PASSWORD);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
